package com.qkl.xiatang.app.dto.message;

import com.qkl.xiatang.app.utils.MsgUtils;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;

import java.util.List;

@Data
public class PersonnelDTO {

    private String name;

    private String number;

    public static PersonnelDTO create(String name,String number){
        PersonnelDTO dto = new PersonnelDTO();
        String numberList = StringUtils.trimToEmpty(number);
        /**
        if(StringUtils.isNotEmpty(numberList)){
            numberList = numberList;
        }
         **/
        dto.setName(StringUtils.trimToEmpty(name));
        dto.setNumber(numberList);
        return dto;
    }

    public static PersonnelDTO create(String name, List<String> pondNames){
        return create(name, MsgUtils.formatPondNames(pondNames));
    }

}
